<div class="nav">
   <a href="{:U('index')}">首页模块列表</a>
   <a class="sel" >模块内容管理</a>
</div>
<div class="search" style="line-height:20px;">
    <div class="fl">
    <div style="margin:6px 3px;">模块名称：<b>{$block.block_name}</b> &nbsp;&nbsp;&nbsp;  风格名称：<b>{$style.style_name}</b></div>
    <table class="table_sub_spec">
        <thead>
            <tr><td>需要内容项</td><td>需要数量</td><td>已添加数量</td><td>图片大小</td><td>操作</td></tr>
        </thead>
    <foreach name="style_item" item="style_item">
        <tr><td>{$style_item.style_item_name}</td>
            <td style="text-align:center">{$style_item.num}</td>
            <td style="text-align:center">{$style_item.num_add}</td>
            <td>宽{$style_item.pic_width}px 高{$style_item.pic_height}px</td>
            <td><if condition="$style_item['type'] eq '产品'">
                <a class="btn_a" href="javascript:add_goods({$block.block_id},{$block.style_id},{$style_item.style_item_id},{$block.cat_id})">添加</a>
                <elseif condition="$style_item['type'] eq '广告'" />
                <a class="btn_a" href="{:U('content_add_adv',Array('block_id'=>$block['block_id'],'style_id'=>$block['style_id'],'style_item_id'=>$style_item['style_item_id']))}">添加</a>
                </if>
            </td>
        </tr>
    </foreach>
    </table>
    </div>
    <div class="fr">
        <a href="__ROOT__{$style.demo_picture}" target="_blank" title="点击查看大图"><img src="__ROOT__{$style.demo_picture}" width="240px" /></a>
    </div>
    <div class="c"></div>
</div>
<div class="list">
<table class="table_list">
  <thead><tr>
    <td>类型</td>
    <td>显示数据</td>
    <td>顺序编号</td>
    <td>是否显示</td>
    <td>操作</td>
  </tr>
  </thead>
  <tbody>
  <foreach name="list" item="item">
    <tr>
        <td>{$item.style_item.type}</td>
        <td style="text-align:left;">
            <if condition="$item['style_item']['type'] eq '产品'">
                <div class="fl"><img src="__ROOT__{$item.picture}" width="100px" /></div>
                <div class="fl" style="margin-left:6px;">
                    商品名称：{$item.goods_name}<br>
                    促销信息：{$item.cuxiao_msg}<br>
                    价格：<font color='red'>￥{$item.price}</font> &nbsp;&nbsp;<span style="text-decoration:line-through;color:#999;"> 市场价：￥{$item.price_market}</span><br>
                    链接地址：<a target="_blank" href="{$item.url}">{$item.url}</a>
                </div>
                <div class="c"></div>
            <elseif condition="$item['style_item']['type'] eq '广告'" />
                <div class="fl"><img src="__ROOT__{$item.picture}" width="100px" /></div>
                <div class="fl" style="margin-left:6px;">
                    标题：{$item.goods_name}<br>
                链接地址：<a target="_blank" href="{$item.url}">{$item.url}</a>
                </div>
                <div clas="c"></div>
            </if>
        </td>
    <td class="edit_input" attr_t="order_id" attr_id="{$item.id}">{$item.order_id}</td>
    <td class="edit_toggle" attr_t="is_show" attr_id="{$item.id}">{$item.is_show}</td>
    <td>
       <if condition="$item['style_item']['type'] eq '产品'">
           <a class="btn_a" href="{:U('content_edit',Array('id'=>$item['id'],'block_id'=>$block['block_id']))}">自定义</a>&nbsp;
       <elseif condition="$item['style_item']['type'] eq '广告'" />
           <a class="btn_a" href="{:U('content_edit_adv',Array('id'=>$item['id'],'block_id'=>$block['block_id']))}">编辑</a>&nbsp;
        </if>
        <a class="btn_a2" href="{:U('content_del',Array('id'=>$item['id']))}" onclick="return confirm('确定删除吗？')">删除</a></td>
     </tr>
  </foreach>
  </tbody>
  <tfoot>
    <tr><td colspan="6"><div class="page">{$page}</div></td></tr>
  </tfoot>
</table>
</div>
<script src="__PUBLIC__/common/artDialog4.1.7/artDialog.source.js?skin=blue" type="text/javascript"></script>
<script src="__PUBLIC__/common/artDialog4.1.7/plugins/iframeTools.source.js" type="text/javascript"></script>
<script type="text/javascript">
    var url_select_tuijian = "{:U('Goods/select_index_tuijian')}";
    //推荐商品
    function add_goods(block_id,style_id,style_item_id,cat_id) {
        art.dialog.open(url_select_tuijian + "?block_id=" + block_id+"&style_id="+style_id+"&style_item_id="+style_item_id+"&cat_id="+cat_id, {title: "选择推荐商品", width: "800px"});
    }
</script>
